from random import randrange

num = int(input('How many dice? '))
sides = int(input('How many sides per die? '))
sumnum = 0
for i in range(num):
    sumnum += randrange(sides) + 1
print('The result is', sumnum)
